import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;

public class Main {
    public static void main(String[] args) {
        Integer[] array = Integers.random(10, 1000, 9999);
        assert array != null;
        System.out.println(Arrays.toString(array));

        SequentialSearch<Integer> sequentialSearch = new SequentialSearch<>(new Comparator<>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1 - o2;
            }
        });

        Random random = new Random();

        int randomIndex = random.nextInt(array.length);
        Integer targetElement = array[randomIndex];
        int index = sequentialSearch.search(array, targetElement);
        Asserts.test(index == randomIndex);
    }
}
